// 统一请求路径前缀在libs/axios.js中修改
import {getRequest, postRequest, putRequest, deleteRequest, uploadFileRequest} from '@/libs/axios';
// 文件上传接口
export const uploadFile = "/base/file/upload"

// 登陆
export const login = (params) => {
    return postRequest('/login/token', params)
}
/**
 * 获取第三方登录配置
 */
export const loginConfig = () => {
    return getRequest('auth/login/other/config')
}
// 退出登录
export const logout = (params) => {
    return getRequest('/logout')
}
// 获取用户登录信息
export const userInfo = () => {
    return getRequest('/auth/user')
}
// 注册
export const regist = (params) => {
    return postRequest('/user/regist', params)
}
// 初始化验证码
export const initCaptcha = (params) => {
    return getRequest('/common/captcha/init', params)
}
// 发送短信验证码
export const sendSms = (params) => {
    return postRequest('/base/common/sendSmsByWeb', params)
}
// 短信验证码登录
export const smsLogin = (params) => {
    return postRequest('/user/smsLogin', params)
}
// IP天气信息
export const ipInfo = (params) => {
    return getRequest('/common/ipinfo', params)
}
// 个人中心编辑
export const userInfoEdit = (params) => {
    return postRequest('/base/user/edit', params)
}
// 个人中心修改密码
export const changePass = (params) => {
    return postRequest('/base/account/resetPassword', params)
}
// 修改其他账户密码
export const resetOtherPwd = (params) => {
    return postRequest('/base/account/resetOtherPwd', params)
}
// 解锁
export const unlock = (params) => {
    return postRequest('/base/user/unlock', params)
}


// github登录
export const githubLogin = (params) => {
    return getRequest('/social/github/login', params)
}
// qq登录
export const qqLogin = (params) => {
    return getRequest('/social/qq/login', params)
}
// 微博登录
export const weiboLogin = (params) => {
    return getRequest('/social/weibo/login', params)
}
// 绑定账号
export const relate = (params) => {
    return postRequest('/base/common/bind_mobile', params)
}
// 获取JWT
export const getJWT = (params) => {
    return getRequest('/social/getJWT', params)
}


// 获取绑定账号信息
export const relatedInfo = (username, params) => {
    return getRequest(`/relate/getRelatedInfo/${username}`, params)
}
// 解绑账号
export const unRelate = (params) => {
    return postRequest('/relate/delByIds', params)
}
// 分页获取绑定账号信息
export const getRelatedListData = (params) => {
    return getRequest('/relate/findByCondition', params)
}


// 用户列表
export const getUserListData = (params) => {
    return postRequest('/base/user/list', params)
}
// 选择用户
export const getUserChoseData = (params) => {
    return postRequest('/base/user/chose', params)
}
export const getHrChoseData = (params) => {
    return postRequest('/base/user/hrChose', params)
}
// 选择员工
export const getStaffChoseData = (params) => {
    return postRequest('/base/user/choseStaff', params)
}
// 添加用户
export const addUser = (params) => {
    return postRequest('/base/user/add', params)
}
// 编辑用户
export const editUser = (params) => {
    return postRequest('/base/user/edit', params)
}
// 启用用户
export const enableUser = (id, params) => {
    return postRequest(`/base/user/enable/${id}`, params)
}
// 禁用用户
export const disableUser = (id, params) => {
    return postRequest(`/base/user/disable/${id}`, params)
}
// 删除用户
export const deleteUser = (userIds, params) => {
    return deleteRequest(`/base/user/delByIds/${userIds}`, params)
}
//根据ID用戶
export const getUser = (id, params) => {
    return getRequest(`/base/user/get/${id}`, params)
}



// 获取一级部门
export const initDepartment = (params) => {
    return getRequest('/base/dept/getByParentId/0', params)
}
// 加载部门子级数据
export const loadDepartment = (id, params) => {
    return getRequest(`/base/dept/getByParentId/${id}`, params)
}
// 添加部门
export const addDept = (params) => {
    return postRequest('/base/dept/add', params)
}
// 编辑部门
export const editDept = (params) => {
    return postRequest('/base/dept/edit', params)
}
// 删除部门
export const deleteDept = (deptId, params) => {
    return postRequest(`/base/dept/delById/${deptId}`, params)
}


// 获取全部角色数据
export const selertRoleList = (params) => {
    return getRequest('/base/role/selertRoleList', params)
}
// 分页获取角色数据
export const getRoleList = (params) => {
    return postRequest('/base/role/list', params)
}
// 添加角色
export const addRole = (params) => {
    return postRequest('/base/role/add', params)
}
// 编辑角色
export const editRole = (params) => {
    return postRequest('/base/role/edit', params)
}
// 设为或取消注册角色
export const setDefaultRole = (params) => {
    return postRequest('/base/role/setDefault', params)
}
// 分配角色权限
export const grantMenu = (params) => {
    return postRequest('/base/role/grant/menu', params)
}
// 删除角色
export const deleteRole = (params) => {
    return postRequest(`/base/role/delByIds`, params)
}

// 查询用户学历
export const workcourseList = (id) => {
    return getRequest(`/base/workcourse/selectByUserId/${id}`)
}


// 查询用户教育经历
export const educationList = (id) => {
    return getRequest(`/base/education/selectByUserId/${id}`)
}

// 获取全部权限数据
export const selectAllMenu = (params) => {
    return getRequest('/base/menu/selectAllMenu', params)
}
// 添加权限
export const addPermission = (params) => {
    return postRequest('/permission/add', params)
}
// 编辑权限
export const editPermission = (params) => {
    return postRequest('/permission/edit', params)
}
// 删除权限
export const deletePermission = (ids, params) => {
    return deleteRequest(`/permission/delByIds/${ids}`, params)
}

// 获取全部字典
export const getAllDictList = (params) => {
    return postRequest('/base/dict/selectAll', params)
}
// 添加字典
export const addDict = (params) => {
    return postRequest('/base/dict/add', params)
}
// 编辑字典
export const editDict = (params) => {
    return postRequest('/base/dict/edit', params)
}
// 删除字典
export const deleteDict = (ids, params) => {
    return deleteRequest(`/base/dict/delByIds/${ids}`, params)
}
// 搜索字典
export const searchDict = (params) => {
    return postRequest('/base/dict/search', params)
}
// 获取全部字典数据
export const getAllDictDataList = (params) => {
    return postRequest('/base/dictdata/list', params)
}
// 添加字典数据
export const addDictData = (params) => {
    return postRequest('/base/dictdata/add', params)
}
// 编辑字典数据
export const editDictData = (params) => {
    return postRequest('/base/dictdata/edit', params)
}
// 删除字典数据
export const deleteData = (ids, params) => {
    return deleteRequest(`/base/dictdata/delByIds/${ids}`, params)
}
// 通过类型获取字典数据
export const getDictDataByType = (type, params) => {
    return getRequest(`/base/dictdata/getByType/${type}`, params)
}


// 分页获取日志数据
export const getLogListData = (params) => {
    return getRequest('/log/getAllByPage', params)
}
// 搜索获取日志数据
export const getSearchLogData = (params) => {
    return getRequest('/log/search', params)
}
// 删除日志
export const deleteLog = (ids, params) => {
    return deleteRequest(`/log/delByIds/${ids}`, params)
}
// 清空日志
export const deleteAllLog = (params) => {
    return deleteRequest('/log/delAll', params)
}


// 分页获取定时任务数据
export const getQuartzListData = (params) => {
    return getRequest('/quartzJob/getAllByPage', params)
}
// 添加定时任务
export const addQuartz = (params) => {
    return postRequest('/quartzJob/add', params)
}
// 编辑定时任务
export const editQuartz = (params) => {
    return postRequest('/quartzJob/edit', params)
}
// 暂停定时任务
export const pauseQuartz = (params) => {
    return postRequest('/quartzJob/pause', params)
}
// 恢复定时任务
export const resumeQuartz = (params) => {
    return postRequest('/quartzJob/resume', params)
}
// 删除定时任务
export const deleteQuartz = (ids, params) => {
    return deleteRequest(`/quartzJob/delByIds/${ids}`, params)
}


// 分页获取消息数据
export const getMessageData = (params) => {
    return postRequest('/base/message/list', params)
}
// 获取单个消息详情
export const getMessageDataById = (id, params) => {
    return getRequest(`/base/message/get/${id}`, params)
}
// 添加消息
export const addMessage = (params) => {
    return postRequest('/base/message/add', params)
}
// 编辑消息
export const editMessage = (params) => {
    return postRequest('/base/message/edit', params)
}
// 删除消息
export const deleteMessage = (ids, params) => {
    return postRequest(`/base/message/delByIds/${ids}`, params)
}
// 分页获取消息推送数据
export const getMessageSendData = (params) => {
    return postRequest('/base/messagesend/list', params)
}
// 编辑发送消息
export const editMessageSend = (params) => {
    return postRequest('/base/messagesend/update', params)
}
// 删除发送消息
export const deleteMessageSend = (ids, params) => {
    return postRequest(`/base/messagesend/delByIds/${ids}`, params)
}


// 分页获取文件数据
export const getFileListData = (params) => {
    return getRequest('/file/getByCondition', params)
}
// 复制文件
export const copyFile = (params) => {
    return postRequest('/file/copy', params)
}
// 重命名文件
export const renameFile = (params) => {
    return postRequest('/file/rename', params)
}
// 删除文件
export const deleteFile = (ids, params) => {
    return deleteRequest(`/file/delete/${ids}`, params)
}
// 下载文件
export const aliDownloadFile = (fKey, params) => {
    return getRequest(`/file/ali/download/${fKey}`, params)
}


// 检查oss配置
export const checkOssSet = (params) => {
    return getRequest('/base/setting/oss/check', params)
}
// 获取oss配置
export const getOssSet = (serviceName, params) => {
    return getRequest(`/base/setting/oss/${serviceName}`, params)
}
// 编辑oss配置
export const editOssSet = (params) => {
    return postRequest('/base/setting/oss/set', params)
}
// 获取sms配置
export const getSmsSet = (serviceName, params) => {
    return getRequest(`/base/setting/sms/${serviceName}`, params)
}
// 获取sms模板code
export const getSmsTemplateCode = (type, params) => {
    return getRequest(`/base/setting/sms/templateCode/${type}`, params)
}
// 编辑sms配置
export const editSmsSet = (params) => {
    return postRequest('/base/setting/sms/set', params)
}
// 获取email配置
export const getEmailSet = (serviceName, params) => {
    return getRequest('/setting/email', params)
}
// 编辑email配置
export const editEmailSet = (params) => {
    return postRequest('/base/setting/email/set', params)
}
// 获取vaptcha配置
export const getVaptchaSet = (params) => {
    return getRequest('/setting/vaptcha', params)
}
// 编辑vaptcha配置
export const editVaptchaSet = (params) => {
    return postRequest('/base/setting/vaptcha/set', params)
}
// 获取vaptcha配置
export const getOtherSet = (params) => {
    return getRequest('base/setting/other', params)
}
// 编辑other配置
export const editOtherSet = (params) => {
    return postRequest('/base/setting/other/set', params)
}
// 查看私密配置
export const seeSecretSet = (settingName, params) => {
    return getRequest(`/base/setting/seeSecret/${settingName}`, params)
}


/*轮播图模块--benin*/

//列表
export const sliderList = (params) => {
    return postRequest('/base/slider/list', params)
}
//添加
export const addSlider = (params) => {
    return postRequest('/base/slider/add', params)
}
//根据ID查询
export const getSlider = (id, params) => {
    return getRequest(`/base/slider/get/${id}`, params)
}
//修改
export const editSlider = (params) => {
    return postRequest('/base/slider/edit', params)
}
//删除
export const delSlider = (ids) => {
    return postRequest('/base/slider/delById', {
        ids: ids
    })
}
//更新上架状态
export const setSendStatus = (params) => {
    return postRequest('/base/slider/setSendStatus', params)
}
/*轮播图模块--end*/



// 查询企业列表
export const companyList = (params) => {
    return postRequest('/base/company/list', params)
}
//添加
export const addCompany = (params) => {
    return postRequest('/base/company/add', params)
}
//根据ID查询
export const getCompany = (id, params) => {
    return getRequest(`/base/company/get/${id}`, params)
}
//根据ID查询
export const getLogin = (id, params) => {
    return getRequest(`/base/company/getLogin/${id}`, params)
}
//修改
export const editCompany = (params) => {
    return postRequest('/base/company/update', params)
}
//删除
export const delCompany = (ids) => {
    return postRequest('/base/company/delByIds', {
        ids: ids
    })
}

//添加企业员工
export const addCompanyUser = (params) => {
    return postRequest('/base/company/adduser', params)
}
//删除企业员工
export const delCompUserByUserIds = (userIds) => {
    return postRequest('/base/company/delByUserIds', {
        userIds: userIds
    })
}


// tree数据
export const selectHtml = (params) => {
    return postRequest('/base/html/tree', params)
}
// 删除
export const delHtml = (id) => {
    return postRequest('/base/html/delById',id)
}
//根据ID查询
export const getHtml = (id, params) => {
    return getRequest(`/base/html/get/${id}`, params)
}

//添加
export const addHtml = (params) => {
    return postRequest('/base/html/add', params)
}
//修改
export const updateHtml = (params) => {
    return postRequest('/base/html/edit', params)
}


// 首页统计
export const homereport = (params) => {
    return postRequest('/base/home/report', params)
}



//  获取关键词列表
export const getKeyWordList = (params) => {
    return postRequest('/base/keyword/list', params)
}
// 添加关键词
export const addKeyWord = (params) => {
    return postRequest('/base/keyword/add', params)
}
// 删除关键词
export const deleteKeyWord = (ids) => {
    return postRequest('/base/keyword/delByIds', {
        ids: ids
    })
}

//  获取打分項
export const getEnumData = (params) => {
    return postRequest('/base/dict/getEnumData', params)
}
//  更新打分項
export const updateEnums = (params) => {
    return postRequest('/base/dict/updateEnums', params)
}


